package com.craney.aboutDispatcher
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	public class ExtendDispatcher extends EventDispatcher
	{
		
		public function ExtendDispatcher()
		{
			
		}
		
		
		
		public override function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void
		{
			trace("override addEventListener");
			super.addEventListener(type, listener, useCapture, priority, useWeakReference);
		}
			
		public override function dispatchEvent(event:Event):Boolean
		{
			trace("override dispatchEvent");
			return super.dispatchEvent(event);
		}

		public function myAddEventListener(listener:Function):String
		{
			trace("myAddEventListener");
			super.addEventListener(NewEvent.DefaultEvent, trickYou, false, 0, false);
			return "I got it in myAddEventListener!";

		}
		
		public function myDispatch():String
		{
			trace("myDispatchEvent");
			super.dispatchEvent(new NewEvent(NewEvent.DefaultEvent));
			return "I got it in myDispatch!";
			
		}

		private function trickYou(evt:Event):void
		{
			trace("You are tricked by me!");
			trace(evt.type);
		}

	}
}